<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>设置我的密码</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
    <link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/css/public.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body>
<div class="layui-fluid" style="padding: 10px">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body" pad15>
          
          <div class="layui-form" lay-filter="">
            <#if msg??>
            <div class="layui-form-item" style="color: red;text-align: center;" >
              ${msg}
            </div>
           </#if>
            <div class="layui-form-item">
              <label class="layui-form-label">当前密码</label>
              <div class="layui-input-inline">
                <input type="password" name="oldPassword" lay-verify="required" lay-verType="tips" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">新密码</label>
              <div class="layui-input-inline">
                <input type="password" name="password" lay-verify="pass" lay-verType="tips" autocomplete="off" id="LAY_password" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux"><table class="pwdLever">
                <tr>
                  <td>弱</td>
                  <td>中</td>
                  <td>强</td>
                </tr>
              </table></div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">确认新密码</label>
              <div class="layui-input-inline">
                <input type="password" name="repassword" lay-verify="repass" lay-verType="tips" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item" style="margin:25px 0 0 0">
              <div class="layui-input-block" style="text-align: center;margin: 0">
                <button class="layui-btn" lay-submit lay-filter="setmypass" type="button">确认修改</button>
                  <!--<button class="layui-btn layui-btn-danger closeWin" type="button">取消</button>-->
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>
</div>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'commons',"form","setter",'jquery'], function(){
  var commons=layui.commons,$=layui.jquery;
  var setter=layui.setter;
  var form=layui.form;
  form.render();
  form.verify(commons.formVerify);
  //密码实时验证
  $("input[name='password']").keyup(function () {
    var num = this.value;
    commons.pwdChangenum(commons.pwdChange(num));
  });

  form.on('submit(setmypass)', function(obj){
    $.ajax({
      url: serverPath.systemPath + setter.sysLinkPath+ "sysUser/modifyPwd"
      ,data: obj.field
      ,type:"post"
      ,dataType:'json'
      ,success: function(data){
        if (commons._filterRecord(data)) {
          parent.layer.alert(data.msg, function (index) {
            parent.layer.close(index);
            parent.layer.close(parent.layer.getFrameIndex(window.name))
          })
        } else {
          window.parent.layer.alert(data.msg);
        }
      }
    });
    return false;
  });
/*$(".layui-btn-danger.closeWin").click(function () {
    parent.layer.close(parent.layer.getFrameIndex(window.name))
})*/
});
</script>
<style scoped>
  .pwdLever td{
    border-right:1px solid #cacaca
  }

</style>
</body>
</html>